﻿#ifndef _GEODATABASE_PROPERTYSET_H
#define _GEODATABASE_PROPERTYSET_H

#include "kernel/Referenced.h"
#include "udatabase/dll_cfg.h"
#include "kernel/string_def.h"
#include "kernel/variant.h"

namespace FD
{
	namespace Utility
	{
		namespace DB
		{
			namespace Interface
			{
			/// <summary>
			/// 属性集合，一般成对出现，Key-Value
			/// </summary>
			class FD_DB_Export IPropertySet : public FD::Kernel::CReferenced
			{
			public:
				/// <summary>
				/// 默认析构函数
				/// </summary>
				virtual ~IPropertySet();
			protected:
				/// <summary>
				/// 默认构造函数
				/// </summary>
				IPropertySet();

			public:		
				/// <summary>
				/// 获取字段数目
				/// </summary>
				/// <returns>字段个数</returns>
				virtual UINT32 getCount() const;
				/// <summary>
				/// 是否存在指定Key值
				/// </summary>
				/// <param name="key">指定Key值</param>
				/// <returns>存在，true；不存在，false</returns>
				virtual bool exist(const String& key)const;
				/// <summary>
				/// 获取指定索引的Key值
				/// </summary>
				/// <param name="key">指定Key值</param>
				/// <returns>存在，true；不存在，false</returns>
				virtual String getKey(UINT32 index)const;  
				/// <summary>
				/// 设置属性值
				/// </summary>
				/// <param name="key">Key值</param>
				/// <param name="value">value值</param>
				/// <returns></returns>
				virtual void setProperty(const String& key,  const FD::Kernel::Variant& value);
				/// <summary>
				/// 获取指定Key值的属性值
				/// </summary>
				/// <param name="key">Key值</param>
				/// <returns>属性值</returns>
				virtual const FD::Kernel::Variant& getProperty(const String& key) const;  
				/// <summary>
				/// 移除指定Key值的属性值
				/// </summary>
				/// <param name="key">Key值</param>
				/// <returns></returns>
				virtual void remove(const String& key);
				/// <summary>
				/// 移除所有属性值
				/// </summary>
				/// <returns></returns>
				virtual void clear();
				/// <summary>
				/// 克隆函数
				/// </summary>
				/// <returns></returns>
				virtual  FD::Utility::DB::Interface::IPropertySet* clone()const;
			};
		}
	}
	}
}

#endif
